import nltk

names = nltk.corpus.names 
print names.fileids()
male_names = names.words('male.txt')
female_names = names.words('female.txt')
#print [w for w in male_names if w in female_names]
print filter(lambda x: x == "Bert", male_names)

namelist = []
namelist.extend(female_names)
namelist.extend(male_names)


print "Tom" in namelist